<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%--STRUTS LAYOUT--%>
<%@ taglib uri="/WEB-INF/tld/struts-layout.tld" prefix="layout" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>


<%--   --%>
<%@ page import="fr.improve.struts.taglib.layout.util.LayoutUtils" %>
<% LayoutUtils.init(pageContext.getServletContext()); %>

<script language="javaScript"> 
	
	function muestraPopupTestigo(codigoInvestigacion)
	{
	
	  var link="<%=response.encodeURL(request.getContextPath()+"/registrarTestigoInvestigacion.do?CInvestigacion=")%>" + + codigoInvestigacion;
	
  	popUpWin = window.open(link, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+450+',height='+350+',left='+10+', top='+10+',screenX='+10+',screenY='+10+'');
	  popUpWin.focus();
	}
	
	function muestraPopupTestigoDetalle(codigoInvestigacion, codigoTestigo)
	{
	
	  	var link="<%=response.encodeURL(request.getContextPath()+
	  	"/registrarTestigoInvestigacion.do?CInvestigacion=")%>" + + codigoInvestigacion + "&CPersona=" +codigoTestigo;
	
  		popUpWin = window.open(link, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+450+',height='+350+',left='+10+', top='+10+',screenX='+10+',screenY='+10+'');
	  	popUpWin.focus();
	}
	
</script>

<layout:html locale="true" styleClass="FORM">
	<layout:panel styleClass="FORM">
		<layout:text property="testigoFilt.CPersona" key="form.CPersona" styleClass="LABEL"></layout:text>
		<layout:text property="testigoFilt.XNombre" key="form.XNombre" styleClass="LABEL"></layout:text>
		<layout:text property="testigoFilt.XApellido" key="form.XApellido" styleClass="LABEL"></layout:text>
		<layout:select property="testigoFilt.CTipoDocumento" key="form.TipoDoc">
			<layout:options collection="TIPO_DOCUMENTO" property="value"
				labelProperty="label"></layout:options>
		</layout:select>
		<layout:text property="testigoFilt.NTipoDocumento" key="form.NTipoDocumento"
			styleClass="LABEL"></layout:text>
		
		<layout:image property="btnBuscarTestigo" altKey="image.buscar.alttext"
			srcKey="image.buscar" bundle="bundle.image"></layout:image>
		<layout:button onclick="muestraPopupTestigo(${RegistrarInvestigacionForm.general.CInvestigacion})">Registrar Testigo </layout:button> 	
	</layout:panel>

	<%--    TESTIGOS ASIGNADOS--%>

	<c:if test='${not empty LISTA_DE_TESTIGO_INV}'>
		<layout:collection id="persona" title="testigo.listaAsig" name="LISTA_DE_TESTIGO_INV" styleClass="FORM" >
			<layout:collectionItem property="CPersona" title="form.CPersona" />
			<layout:collectionItem property="XNombre" title="form.XNombre" />
			<layout:collectionItem property="XApellido" title="form.XApellido" />
			<layout:collectionItem title="denuncia.ver" ><center>
			<layout:img srcName="ver.gif" border="0" onclick="muestraPopupTestigoDetalle(${RegistrarInvestigacionForm.general.CInvestigacion}, ${persona.CPersona })"/>
	  		</center></layout:collectionItem>
		</layout:collection>
		
</c:if>




<%-- 	TESTIGOS NO ASIGNADOS--%>
	<c:if test='${not empty LISTA_DE_TESTIGO}'>
		<layout:collection id="persona" title="testigo.lista" name="LISTA_DE_TESTIGO" styleClass="FORM" selectProperty="CPersona"
			 selectType="checkbox" selectName="idSeleccionTestigo" >
			<layout:collectionItem property="CPersona" title="form.CPersona" />
			<layout:collectionItem property="XNombre" title="form.XNombre" />
			<layout:collectionItem property="XApellido" title="form.XApellido" />
		</layout:collection>
		
</c:if>

</layout:html>




